import Mock from 'mockjs';

Mock.mock(/\/login/, 'post', (options) => {
  const { body } = options;
  const { username, password } = JSON.parse(body);
  if (username === 'user' && password === '123456') {
    return { code: 1, msg: '登录成功', result: { username: 'user' } };
  } else {
    return { code: 0, msg: '用户名密码错误', result: null };
  }
});
